package xd.ylwy.student.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import xd.ylwy.student.entity.TbStudent;
import xd.ylwy.student.mapper.TbStudentMapper;
import xd.ylwy.student.service.ITbStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xd
 * @since 2022-09-23
 */
@Service
public class TbStudentServiceImpl extends ServiceImpl<TbStudentMapper, TbStudent> implements ITbStudentService {
    @Autowired
    private TbStudentMapper tbStudentMapper;
    public List<Map<String, Object>> findAll(){return tbStudentMapper.findAll();}
    public List<Map<String, Object>> findGrade(){return tbStudentMapper.findGrade();}
    public List<Map<String, Object>> findSex(){return tbStudentMapper.findSex();}
    public List<Map<String, Object>> findFaculty(){
            return tbStudentMapper.findFaculty();
        }
    public List<TbStudent> likeFind(String student){
        QueryWrapper<TbStudent> wrapper = Wrappers.query();
        wrapper.like("id",student).or().like("name",student).or().like("faculty",student);
        return tbStudentMapper.selectList(wrapper);

    }
}
